<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier_html_xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="${aier_content_type}" />
<meta name="keywords" content="${aier_keyworks}" />
<meta name="description" content="${aier_description}" />
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}ui.css" />
<link rel="stylesheet" href="${aier_css_url}b.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}text.css" />
<link rel="stylesheet"
	href="${aier_css_url}${aier_jqui_css}enhanced.css" />
<link rel="stylesheet" href="${aier_css_url}proxy/qcs.css" />

<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/afu.js"></script>
<script type="text/javascript" src="${aier_js_url}jt/td.js"></script>
<script type="text/javascript" src="${aier_js_url}97/WdatePicker.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/arrayList.js"></script>
<script type="text/javascript" src="${aier_js_url}${aier_jqui_js}ui.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript"
	src="${aier_js_url}${aier_jqui_js}custominput.js"></script>
<script type="text/javascript"
	src="${aier_js_url}${aier_jqui_js}text.js"></script>
<style type="text/css">
.input_opacity{
	filter:alpha(opacity=0); -moz-opacity:0; opacity: 0;
}
.input_hidden{
	visibility: hidden;
}
</style>
</head>
<body style="background-color: #EEF2FB;">
	<div id="tabs">
		<ul>
			<li><a href="#tabs-1">快速建校</a></li>
		</ul>
		<div id="tabs-1" style="height: 500px;">
			<div class="d_content">
				<div class="d_scnOut">
					<div class="d_scname">
						<label for="txt_scName">导入模板信息:</label>
					</div>
					
					<div class="d_sctext" >
						<input type="file" id="file" name="file" onchange="txt_path.value=this.value" 
								style="width: 74px;height: 36px; margin-top: -3px; margin-left: 13px;
								font-size: 14px;font-family: 新宋体,宋体,微软雅黑,Lucida Grande,Lucida Sans,Arial,sans-serif;
								position:absolute; z-index: 2;">	
						<button id="b_selfile"
							style="width: 86px;margin-left: -40px; margin-top: -3px;" 
							class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
							role="button" aria-disabled="false">
							<span class="ui-button-text">选择文件</span>
						</button>
						
					</div>
					<div class="d_sctext" style="margin-left: 235px;">
						<input type="text" id="txt_path" class="txt_scname"
							>
					</div>
					<div style="margin-top: -25px;margin-left: 65px;">
						<button onclick="loadExcle()"
							class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
							role="button" aria-disabled="false">
							<span class="ui-button-text">上传</span>
						</button>
						<button id="but_jump"
							class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
							role="button" aria-disabled="false">
							<span class="ui-button-text">进入 生成模板</span>
						</button>
						<button id="b_blank"
							class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
							role="button" aria-disabled="false">
							<span class="ui-button-text">直接下载空白模板</span>
						</button>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	$("#tabs").tabs();
	
	$(document).ready(function() {
		//判断是否是ie浏览器， 在IE下document.all值为1，而其他浏览器下的值为0；
		var flag = document.all ? 'IE' : 'others';
		if (flag == 'IE') {
			$("#file").addClass("input_opacity");
			$("#file").removeClass("input_hidden");
		} else {
			$("#file").addClass("input_hidden");
			$("#file").removeClass("input_opacity");
			//上传文件按钮模拟点击
			$("#b_selfile").click(function() {
				$("#file").click();
			});
		}
         
	});

	function loadExcle() {
		try {
			$
					.ajaxFileUpload({
						url : "${aier_url}${aier_urijs}quickscupload${aier_suffix}?pid=${pid}",
						secureuri : false,
						fileElementId : 'file',
						dataType : 'json',
						success : function(data, status) {

							if (1 == data.s) {
								alert("上传成功");
							} else {
								alert("上传失败");
								alert(data.se);
							}
						},
						error : function(data, status, e) {
							alert("服务器连接超时");
						}
					});
		} catch (e) {
			alert("服务器连接超时");
		}
	}

	$('#but_jump')
			.click(
					function() {
						location.href = "${aier_url}proxy/creates_createInfo${aier_suffix}?pid=${pid}";
					});
	$('#b_blank').click(function() {
		location.href = "${data_url}proxy_school.xls";
	});

	//上传文件按钮模拟点击
	//$("#b_selfile").click(function() {
	//	$("#file").click();
	//	$("#file").change(function() {
	//		$("#txt_path").val($("#file").val());
	//	});

	//});
</script>
</html>